package org.robotlegs.xxl.base 
{
	import org.robotlegs.core.IMediator;
	
	/**
	 * Mediator基类，定义了注册和删除的前后置方法架子
	 * @author XXL
	 */
	public class MediatorBase implements IMediator 
	{
		protected var removed:Boolean;
		
		protected var viewComponent:Object;
		
		public function MediatorBase() 
		{
			
		}
		
		/* INTERFACE org.robotlegs.core.IMediator */
		
		public function preRegister():void 
		{
			removed = false;
			onRegister();
		}
		
		public function onRegister():void 
		{
			
		}
		
		public function preRemove():void 
		{
			removed = true;
			onRemove();
		}
		
		public function onRemove():void 
		{
			
		}
		
		public function getViewComponent():Object 
		{
			return viewComponent;
		}
		
		public function setViewComponent(viewComponent:Object):void 
		{
			this.viewComponent = viewComponent;
		}
		
	}

}